/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package carrello.impl.boundary.user;

import carrello.impl.boundary.AbstractUI;
import carrello.impl.controller.user.BrowseCategoryCTRL;
import carrello.model.association.ProductBelongsToCategory;
import carrello.model.entities.Product;
import java.util.ArrayList;
import java.util.List;
import org.omg.PortableInterceptor.SYSTEM_EXCEPTION;

/**
 *
 * @author mepcotterell
 */
public class BrowseCategoryUI extends AbstractUI {
    
    private String catName = null;
    private List<Product> productList = new ArrayList<Product>();
    private int numOfProducts = 0;
 
    public String execute()
    {
        productList = BrowseCategoryCTRL.getProductByCategoryName(catName);
        setNumOfProducts(productList.size());
        return INPUT;
    }

    /**
     * @return the catName
     */
    public String getCatName() {
        return catName;
    }

    /**
     * @param catName the catName to set
     */
    public void setCatName(String catName) {
        this.catName = catName;
    }

    /**
     * @return the productList
     */
    public List<Product> getProductList() {
        return productList;
    }

    /**
     * @param productList the productList to set
     */
    public void setProductList(List<Product> productList) {
        this.productList = productList;
    }

    /**
     * @return the numOfProducts
     */
    public int getNumOfProducts() {
        return numOfProducts;
    }

    /**
     * @param numOfProducts the numOfProducts to set
     */
    public void setNumOfProducts(int numOfProducts) {
        this.numOfProducts = numOfProducts;
    }
    
}
